home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -websites- / wirenet / files / thor25_arexx.lha / GoldED / PreviewMsg.ged < prev    next >
Text File  |  1996-10-26  |  965b  |  46 lines

  1. /* PreviewMsg.ged by Troels Walsted Hansen
  2. ** $VER: PreviewMsg.ged v1.00 (09.06.95)
  3. **
  4. ** An ARexx script that shows you (in THOR's messagetext listview)
  5. ** what your message will look like when read by others in THOR.
  6. */
  7.  
  8. options results
  9.  
  10. /* needs GoldED and THOR functions */
  11.  
  12. if(substr(address(),1,6) ~= "GOLDED") then
  13. do
  14.     say "This script should only be started from inside GoldED."
  15.     exit 20
  16. end
  17. else gedport = address()
  18.  
  19. p = ' ' || address() || ' ' || show('P',,)
  20. thorport = pos(' THOR.',p)
  21.  
  22. if thorport > 0 then thorport = word(substr(p,thorport+1),1)
  23. else
  24. do
  25.     say 'No THOR port found!'
  26.     exit 10
  27. end
  28.  
  29. /* preview msg text in THOR */
  30.  
  31. address(gedport)
  32. QUERY DOC VAR OLDNAME
  33. SAVE ALL NAME '"t:PreviewMsg.fse.temp.file"'
  34. NAME NEW oldname
  35.  
  36. address(thorport)
  37. THORTOFRONT
  38. SHOWTEXT 't:PreviewMsg.fse.temp.file'
  39. if(rc ~= 0) then REQUESTNOTIFY TEXT '"'THOR.LASTERROR'"' BT '"_Ok"'
  40.  
  41. /* cleanup and exit */
  42.  
  43. address command
  44. 'delete >nil: t:PreviewMsg.fse.temp.file'
  45. exit
  46.